<?php

use yii\helpers\Html;
use yii\widgets\DetailView;

/* @var $this yii\web\View */
/* @var $model app\models\User */

$this->title = '班级战斗排行榜';
$this->params['breadcrumbs'][] = $this->title;
$ranking = 0;
?>
<div class="user-view col-lg-8">

    <h1><?= Html::encode($this->title) ?></h1>
    <?php foreach($data as $user){ $ranking++ ?>
        <div class="progress">

            <div class="progress-bar progress-bar-<?php if(in_array($ranking,array(1,2,3))){ echo 'danger';}else{echo 'success';} ?> progress-bar-striped active" role="progressbar" aria-valuenow="45" aria-valuemin="0" aria-valuemax="100" style="width: <?php echo $user['rate']; ?>%">
                <span class="sr-only">45% Complete</span>
                <?php echo $user['truename']."--第".$ranking."名"; ?> 综合战斗力<?php echo "--".$user['rate']; ?>%
            </div>
        </div>
    <?php }; ?>

    <div class="alert alert-success" role="alert"><?php echo Yii::$app->params['rateRule']; ?></div>



</div>
